import { ref } from 'vue'
import PageContent from '@/components/page-content'

export function usePageSearch() {
  const pageContentRef = ref<InstanceType<typeof PageContent>>()
  // 重置按钮逻辑
  const handleResetBtn = () => {
    pageContentRef.value?.getPageData()
  }

  // 搜索按钮逻辑
  const handleSearchBtn = (queryInfo: any) => {
    pageContentRef.value?.getPageData(queryInfo)
  }

  return [pageContentRef, handleResetBtn, handleSearchBtn]
}
